package cn.cs.controller;

import cn.cs.common.Dto;
import cn.cs.common.DtoUtil;
import cn.cs.service.AppSettlementService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;


@RestController
@RequestMapping(value = "/appSettlement")
public class AppSettlementController {

    @Resource
    private AppSettlementService appSettlementService;


    /**
     * 分页查询 维修工结算申请 / 历史查看
     * @param pageNumber
     * @param pageSize
     * @param appState 申请状态0 申请中 1已完成(历史)
     * @param nickname
     * @param phone
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/csPlatform/getAppSettlementByPage")
    public Dto getAppSettlementByPage(Integer pageNumber, Integer pageSize, String appState, String nickname, String phone) throws Exception {
        Map<String, Object> param = new HashMap<>();
        param.put("appState", appState);
        param.put("nickname", nickname);
        param.put("phone", phone);
        return DtoUtil.returnSuccess("获取成功", appSettlementService.queryAppSettlementPageByMap(param, pageNumber, pageSize));
    }


}
